<?php
/**
 * 
 * @author truonggm
 * @Created 05/04/2011
 *
 */

class Role_PrivilegeController extends Zend_Controller_Action {
	
	public function indexAction(){
		$role_id = $this->_request->getParam ('id');
		$business = new Role_Models_Business_Role();
		$result = $business->getRolePrivileges($role_id);
		echo $result;		
		//echo '{"success":true,"data":{"name":"Admin","privilege":"5,2"}}';
		$this->_helper->layout()->disableLayout();
	}
	
	public function updateAction(){
		
		$vc_privilegeId = $this->_request->getParam ('privilegeId');
		$vn_roleId = $this->_request->getParam ('id');
		
		$arr_data["privilegeId"]=$vc_privilegeId;
		$arr_data["roleId"]=$vn_roleId;
		
		$business = new Role_Models_Business_Role();
		$result = $business->updateRolePrivileges(Zend_Json::encode($arr_data));
		echo $result;	
		$this->_helper->layout()->disableLayout();
	}
}


?>